<div class="widget-head" style="margin-top:0;">
    <div class="widget-title">配置列表</div>
</div>
<div class="layui-container" style="width:100%;">
    <table id="list"></table>
    <script type="text/html" id="barDemo">
        <div class="layui-btn-group action-btn">
            <a class="layui-btn layui-btn-xs" href="javascript:think_open('/admin/config/show/id/{{d.id}}','添加',['60%','630px'],0);">查看</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs mini_del" data-url="/admin/config/del/ids/{{d.id}}">删除</a>
        </div>
    </script>
</div>
<script>
    layui.use(['think'], function() {
        var think = layui.think;
        //第一个实例
        think.render({
            elem: '#list',
            // height: 500,
            url: '/admin/config/getdata',
            page: true,
            toolbar: true,
            cols: [
                [ //表头
                    {
                        type: 'checkbox',
                        fixed: 'left'
                    }, {
                        field: 'id',
                        title: 'ID',
                        sort: true,
                        width: 80,
                        fixed: 'left'
                    }, {
                        field: 'key',
                        title: '配置Key',
                        fixed: 'left'
                    }, {
                        field: 'name',
                        title: '配置名称',
                        sort: true
                    }, {
                        field: 'update_time',
                        title: '修改时间',
                        width: 177,
                        sort: true,
                        templet: function(d) {
                            return think_time(d.update_time, 'Y-m-d H:i:s'); //think_time()是think.js里面的方法
                        }
                    }, {
                        title: '操作',
                        width: 240,
                        align: 'center',
                        toolbar: '#barDemo'
                    }
                ]
            ]
        }, '{$_GET["searchtype"]}', '{$_GET["keywords"]}');
    });
</script>